<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/WEB-INF/template/templateAdmin.xhtml">

	<ui:define name="content">
		<h:form>
			<f:loadBundle basename="properties.messages" var="msg" />
			<center class="ViewUsers">
				<div class="createRepTitle">#{msg.edit}</div>
				<br />
				<center>
					<h:panelGrid columns="3" bgcolor="#F1F1F1" border="10"
						cellpadding="8" first="0" rows="5" width="50%" frame="box"
						rules="all">
						<h:outputText value="#{msg.username}" />
						<h:inputText id="uName" value="#{editUserController.etUser.name}"
						validator="#{editUserController.validateName1}"
							>
							<f:validator validatorId="userName2Validator" />
							<f:ajax event="blur" render="uNameMess" />
						</h:inputText>
						<h:message id="uNameMess" for="uName" style="color:red" />

						<h:outputText value="#{msg.mail}"></h:outputText>
						<h:inputText id="mail" value="#{editUserController.etUser.email}"
						validator="#{editUserController.validateEmail1}">
							<f:validator validatorId="emailValidatorEdit" />
							<f:ajax event="blur" render="mailMess" />
						</h:inputText>
						<h:message id="mailMess" for="mail" style="color:red" />

						<h:outputText value="#{msg.phone}"></h:outputText>
						<h:inputText id="phone"
							value="#{editUserController.etUser.telephone}">
							<f:validator validatorId="phoneValidator" />
							<f:ajax event="blur" render="phoneMess" />
						</h:inputText>
						<h:message for="phone" id="phoneMess" style="color:red" />

						<h:outputText value="#{msg.userType}"></h:outputText>
						<h:outputText value="#{msg[editUserController.etUser.type]}"></h:outputText>
					</h:panelGrid>
					<br /> <br />
				</center>
				<h:commandButton class="selectRepositoryButton" value="#{msg.save}"
					action="#{editUserController.update}">
				</h:commandButton>
				<h:commandButton class="selectRepositoryButton" value="#{msg.back}"
					immediate="true" action="ViewUsers.xhtml" />

			</center>
		</h:form>
	</ui:define>
</ui:composition>
</html>